


<style>
    .request_data_table input{width: 80px!important;padding-left: 10px;}
    .reward-tab{padding: 10px;height: 100%;width: 849px;margin-left: 69px;}
    .share-reward input{margin-top:20px;}
    .add-share,.add-team{cursor: pointer;background-color: rgb(0,166,90); display:inline-block;text-align: center;font-size: 20px; line-height: 22px;width: 22px}
    .reduce-share,.reduce-team{cursor: pointer;background-color:  rgb(221,75,57); display:inline-block;text-align: center;font-size: 20px; line-height: 22px;width: 22px}
</style>


<div class="x-body">
    <div class="layui-form form_single" id="form" action="{:url()}" method="post">
        <div class="layui-form-item">
            <label for="pid" class="layui-form-label">
                <span class="x-red">*</span>赌王
            </label>
            <div class="layui-input-block" >
                <select id="pid" name="king_id" lay-filter="test1">
                    {volist name='king_list' id='vo'}

                    <option value="{$vo.id}" {notempty name="info" }{if condition="  $info['king_id'] eq $vo['id']"} selected {/if}{/notempty}>{$vo.name}</option>
                    {/volist}
                </select>
            </div>
            <div class="layui-form-mid layui-word-aux">
                (赌王)
            </div>

        </div>
        {notempty name="info" }
            {if condition="$type eq 2"}
                <div class="layui-form-item"  id="user_investment" >
                    <label for="user_investment_id" class="layui-form-label">
                        <span class="x-red">*</span>赌王产品
                    </label>
                    <div class="layui-input-block">
                        <select id="user_investment_id" name="user_investment_id" lay-filter="test2">
                                    {volist name="investment_list" id="v"}
                                        <option value="{$v.id}" {notempty name="info" }{if condition="  $info['user_investment_id'] eq $v['id']"} selected {/if}{/notempty}>{$v.name}</option>
                                    {/volist}
                        </select>
                    </div>
                    <div class="layui-form-mid layui-word-aux">
                        (赌王产品)
                    </div>

                </div>
            {else/}
                <div class="layui-form-item"  id="user_investment" style="display: none">
                    <label for="user_investment_id" class="layui-form-label">
                        <span class="x-red">*</span>赌王产品
                    </label>
                    <div class="layui-input-block">
                        <select id="user_investment_id" name="user_investment_id" lay-filter="test2">

                        </select>
                    </div>
                    <div class="layui-form-mid layui-word-aux">
                        (赌王产品)
                    </div>

                </div>
            {/if}
        {else/}
            <div class="layui-form-item"  id="user_investment" style="display: none">
                <label for="user_investment_id" class="layui-form-label">
                    <span class="x-red">*</span>赌王产品
                </label>
                <div class="layui-input-block">
                    <select id="user_investment_id" name="user_investment_id" lay-filter="test2">

                    </select>
                </div>
                <div class="layui-form-mid layui-word-aux">
                    (赌王产品)
                </div>

            </div>
        {/notempty}



        <div class="layui-form-item">
            <label class="layui-form-label">
                <span class="x-red">*</span>内容
            </label>
            <div class="layui-input-block">
                <textarea class="form-control textarea_editor" name="content" placeholder="请输入内容">{$info['content']|default=''}</textarea>
                {:widget('editor/index', array('name'=> 'content','value'=> ''))}
            </div>
        </div>




            </tbody>
        </table>














        <div class="box-footer">
            <input type="hidden" name="type" value="{$type}"/>
            <input type="hidden" name="id" value="{$info['id']|default='0'}"/>

            {include file="layout/edit_btn_group"/}

        </div>

</form>
</div>
</div>
<script>
    layui.use('form', function(){

        var type="{$type}";


        if(type==2 || type==3){
            var form = layui.form;
            form.on('select(test1)', function(data){
                $.post("{:url('ActionAdd')}",{king:1,king_id:data.value},function (d) {
                    if(d){
                        var html='';
                        for (var i=0;i<d.length;i++){
                            html+=' <option value="'+d[i]['id']+'" >'+d[i]['name']+'</option>';
                        }
                        $('#user_investment_id').html(html);
                        $('#user_investment').show();
                        form.render('select');

                    }
                })
            });
        }

    });


</script>
